﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using DTO;
using DAO;
namespace Banking.Quản_lý
{
    public partial class DanhSachChucVu : UserControl
    {
        private int type;
        public DanhSachChucVu(int _type)
        {
            InitializeComponent();
            type = _type;
        }

        public void init(int ma)
        {
            List<ChucVu> lst = ChucVuDAO.DSChucVu(ma);
            dgvDSChucVu.DataSource = lst;

            dgvDSChucVu.Columns["DelFlg"].Visible = false;
            dgvDSChucVu.Columns["TenChucVu"].Visible = false;
        }

        private void btnXemChiTiet_Click(object sender, EventArgs e)
        {
            if (dgvDSChucVu.SelectedRows.Count == 1)
            {
                int ma = int.Parse(dgvDSChucVu.SelectedRows[0].Cells["MaChucVu"].Value.ToString());
                XemChiTietChucVu ct = new XemChiTietChucVu(type);
                ct.init(ma);
                ct.ShowDialog();


            }
        }

    }
}
